<template>
    <div class="d-flex justify-content-between align-items-center border-bottom pt-2 pb-3">
        <button 
            class="btn btn-outline-primary"
            @click="$emit('upload')"
        >
            <i class="bi bi-upload"></i> 上传文件
        </button>

        <div class="action-buttons d-flex gap-2">
            <button 
                class="btn btn-outline-danger"
                @click="$emit('deleteSelected')"
                :disabled="selectedCount === 0"
                :title="`删除选中的 ${selectedCount} 个文件`"
            >
                <i class="bi bi-trash"></i> 
                删除<span v-if="selectedCount > 0"> ({{ selectedCount }})</span>
            </button>
            <button 
                class="btn btn-outline-secondary"
                :disabled="totalCount === 0"
            >
                <i class="bi bi-download"></i> 下载
            </button>
        </div>
    </div>
</template>

<script setup lang="ts">
interface Props {
    selectedCount?: number
    totalCount?: number
}

withDefaults(defineProps<Props>(), {
    selectedCount: 0,
    totalCount: 0
})

defineEmits<{
    upload: []
    deleteSelected: []
}>()

</script>

<style scoped>
</style>